package com.osard.screen.utils;

import android.os.Handler;
import android.os.Looper;

/**
 * 用途：
 * <p>
 * 作者：MJSoftKing
 */
public class HandlerUtils {

    /**
     * 主线程触发方法
     */
    public static void mainPost(Runnable runnable) {
        new Handler(Looper.getMainLooper()).post(runnable);
    }

    /**
     * 当前线程触发方法
     */
    public static void currentPost(Runnable runnable) {
        new Handler(Looper.myLooper()).post(runnable);
    }

    /**
     * 主线程延迟触发方法
     */
    public static void mainPostDelayed(Runnable runnable, long delayMillis) {
        new Handler(Looper.getMainLooper()).postDelayed(runnable, delayMillis);
    }

    /**
     * 当前线程延迟触发方法
     */
    public static void currentPostDelayed(Runnable runnable, long delayMillis) {
        new Handler(Looper.myLooper()).postDelayed(runnable, delayMillis);
    }
}
